/*
 * AnchorLayout.cpp
 *
 *  Created on: May 14, 2017
 *      Author: wangguojian
 */

#include "AnchorLayout.h"
//
//class AnchorHorizontalImpl
//{
//public:
//	AnchorHorizontalImpl()
//		: left(AnchorLeft()),
//		  right(AnchorRight()),
//		  width(0)
//	{
//
//	}
//	AnchorLeft left;
//	AnchorRight right;
//	float width;
//};
//
//class AnchorVerticalImpl
//{
//public:
//	AnchorVerticalImpl()
//		: top(AnchorTop()),
//		  bottom(AnchorBottom()),
//		  height(0)
//	{
//	}
//	AnchorTop top;
//	AnchorBottom bottom;
//	float height;
//};
//AnchorLayout::AnchorLayout()
//	: horizontal(AnchorHorizontal()),
//	  vertical(AnchorVertical())
//{
//}
//
//AnchorLayout::AnchorLayout(const AnchorLayout& other)
//	: horizontal(other.horizontal),
//	  vertical(other.vertical)
//{
//}
//
//AnchorLayout::AnchorLayout(const AnchorHorizontal& horizontal, const AnchorVertical& vertical)
//	: horizontal(horizontal),
//	  vertical(vertical)
//{
//}
//
//AnchorLayout::~AnchorLayout()
//{
//}
//
//
//AnchorLeft::AnchorLeft(CrossApp::CAView* parent, float margin,
//		AnchorHorizontal::Alignment alignment)
//	: mParent(parent),
//	  mAlignment(alignment),
//	  mMargin(margin)
//{
//}
//
//AnchorLeft::~AnchorLeft()
//{
//}
//
//CrossApp::CAView* AnchorLeft::getParentView() const
//{
//	return mParent;
//}
//
//AnchorHorizontal::Alignment AnchorLeft::getAlignment() const
//{
//	return mAlignment;
//}
//
//float AnchorLeft::getMargin() const
//{
//	return mMargin;
//}
//
//AnchorLeft::AnchorLeft()
//	: AnchorBase()
//{
//}
//
//AnchorLeft& AnchorLeft::operator =(const AnchorLeft& other)
//{
//	this->mParent = other.mParent;
//	this->mMargin = other.mMargin;
//	this->mAlignment = other.mAlignment;
//	return *this;
//}
//
//AnchorRight::AnchorRight(CrossApp::CAView* parent, float margin,
//		AnchorHorizontal::Alignment alignment)
//	: mParent(parent),
//	  mAlignment(alignment),
//	  mMargin(margin)
//{
//}
//
//AnchorRight::~AnchorRight()
//{
//}
//
//CrossApp::CAView* AnchorRight::getParentView() const
//{
//	return mParent;
//}
//
//AnchorHorizontal::Alignment AnchorRight::getAlignment() const
//{
//	return mAlignment;
//}
//
//float AnchorRight::getMargin() const
//{
//	return mMargin;
//}
//
//AnchorRight::AnchorRight()
//	: mParent(nullptr),
//	  mAlignment(AnchorHorizontal::Alignment::Invalid),
//	  mMargin(0)
//{
//}
//
//AnchorRight& AnchorRight::operator =(const AnchorRight& other)
//{
//	this->mParent = other.mParent;
//	this->mMargin = other.mMargin;
//	this->mAlignment = other.mAlignment;
//	return *this;
//}
//
//AnchorTop::AnchorTop(CrossApp::CAView* parent, float margin,
//		AnchorVertical::Alignment alignment)
//	: mParent(parent),
//	  mAlignment(alignment),
//	  mMargin(margin)
//{
//}
//
//AnchorTop::~AnchorTop()
//{
//}
//
//CrossApp::CAView* AnchorTop::getParentView() const
//{
//	return mParent;
//}
//
//AnchorVertical::Alignment AnchorTop::getAlignment() const
//{
//	return mAlignment;
//}
//
//float AnchorTop::getMargin() const
//{
//	return mMargin;
//}
//
//AnchorTop::AnchorTop()
//	: mParent(nullptr),
//	  mAlignment(AnchorVertical::Alignment::Invalid),
//	  mMargin(0)
//{
//}
//
//AnchorTop& AnchorTop::operator =(const AnchorTop& other)
//{
//	this->mParent = other.mParent;
//	this->mMargin = other.mMargin;
//	this->mAlignment = other.mAlignment;
//	return *this;
//}
//
//AnchorBottom::AnchorBottom(CrossApp::CAView* parent, float margin,
//		AnchorVertical::Alignment alignment)
//	: mParent(parent),
//	  mAlignment(alignment),
//	  mMargin(margin)
//{
//}
//
//AnchorBottom::~AnchorBottom()
//{
//}
//
//CrossApp::CAView* AnchorBottom::getParentView() const
//{
//	return mParent;
//}
//
//AnchorVertical::Alignment AnchorBottom::getAlignment() const
//{
//	return mAlignment;
//}
//
//float AnchorBottom::getMargin() const
//{
//	return mMargin;
//}
//
//AnchorBottom::AnchorBottom()
//	: mParent(nullptr),
//	  mAlignment(AnchorVertical::Alignment::Invalid),
//	  mMargin(0)
//{
//}
//
//AnchorBottom& AnchorBottom::operator =(const AnchorBottom& other)
//{
//	this->mParent = other.mParent;
//	this->mMargin = other.mMargin;
//	this->mAlignment = other.mAlignment;
//	return *this;
//}
//
//AnchorHorizontal::AnchorHorizontal()
//	: mImpl(new AnchorHorizontalImpl())
//{
//}
//
//AnchorHorizontal::AnchorHorizontal(const AnchorHorizontal& other)
//	: mImpl(new AnchorHorizontalImpl())
//{
//	mImpl->left = other.mImpl->left;
//	mImpl->right = other.mImpl->right;
//	mImpl->width = other.mImpl->width;
//}
//
//AnchorHorizontal::AnchorHorizontal(const AnchorLeft& left, const AnchorRight& right)
//	: mImpl(new AnchorHorizontalImpl())
//{
//	mImpl->left = left;
//	mImpl->right = right;
//}
//
//AnchorHorizontal::AnchorHorizontal(const AnchorLeft& left, float width)
//	: mImpl(new AnchorHorizontalImpl())
//{
//	mImpl->left = left;
//	mImpl->width = width;
//}
//
//AnchorHorizontal::AnchorHorizontal(const AnchorRight& right, float width)
//	: mImpl(new AnchorHorizontalImpl())
//{
//	mImpl->right = right;
//	mImpl->width = width;
//}
//
//AnchorHorizontal::~AnchorHorizontal()
//{
//	delete mImpl;
//	mImpl = nullptr;
//}
//
//AnchorLeft AnchorHorizontal::getLeft() const
//{
//	return mImpl->left;
//}
//
//AnchorRight AnchorHorizontal::getRight() const
//{
//	return mImpl->right;
//}
//
//float AnchorHorizontal::getWidth() const
//{
//	return mImpl->width;
//}
//
//AnchorVertical::AnchorVertical()
//	: mImpl(new AnchorVerticalImpl())
//{
//}
//
//AnchorVertical::AnchorVertical(const AnchorVertical& other)
//	: mImpl(new AnchorVerticalImpl())
//{
//	mImpl->bottom = other.mImpl->bottom;
//	mImpl->top = other.mImpl->top;
//	mImpl->height = other.mImpl->height;
//}
//
//AnchorVertical::AnchorVertical(const AnchorTop& top, const AnchorBottom& bottom)
//	: mImpl(new AnchorVerticalImpl())
//{
//	mImpl->top = top;
//	mImpl->bottom = bottom;
//}
//
//AnchorVertical::AnchorVertical(const AnchorTop& top, float height)
//	: mImpl(new AnchorVerticalImpl())
//{
//	mImpl->top = top;
//	mImpl->height = height;
//}
//
//AnchorVertical::AnchorVertical(const AnchorBottom& bottom, float height)
//	: mImpl(new AnchorVerticalImpl())
//{
//	mImpl->bottom = bottom;
//	mImpl->height = height;
//}
//
//AnchorVertical::~AnchorVertical()
//{
//}
//
//AnchorTop AnchorVertical::getTop() const
//{
//	return mImpl->top;
//}
//
//AnchorBottom AnchorVertical::getBottom() const
//{
//	return mImpl->bottom;
//}
//
//float AnchorVertical::getHeight() const
//{
//	return mImpl->height;
//}
//
//AnchorHorizontal& AnchorHorizontal::operator =(const AnchorHorizontal& other)
//{
//	mImpl->left = other.mImpl->left;
//	mImpl->right = other.mImpl->right;
//	mImpl->width = other.mImpl->width;
//	return *this;
//}
//
//AnchorVertical& AnchorVertical::operator =(const AnchorVertical& other)
//{
//	mImpl->bottom = other.mImpl->bottom;
//	mImpl->top = other.mImpl->top;
//	mImpl->height = other.mImpl->height;
//	return *this;
//}
//
//AnchorLayout::AnchorLayout(const AnchorLeft& left, const AnchorRight& right, const AnchorTop& top,
//		const AnchorBottom& bottom)
//	: horizontal(AnchorHorizontal(left, right)),
//	  vertical(AnchorVertical(top, bottom))
//{
//}
//
//AnchorLayout& AnchorLayout::operator =(const AnchorLayout& other)
//{
//	this->horizontal = other.horizontal;
//	this->vertical = other.vertical;
//	return *this;
//}

AnchorBase::AnchorBase()
	: mAlignmentView(nullptr),
	  mAlignmentH(AnchorBase::AlignmentH::Invalid),
	  mAlignmentV(AnchorBase::AlignmentV::Invalid),
	  mMargin(0)
{
}

AnchorBase::AnchorBase(CrossApp::CAView* alignmentView, float margin, AnchorBase::AlignmentH alignment)
	: mAlignmentView(alignmentView),
	  mAlignmentH(alignment),
	  mAlignmentV(AnchorBase::AlignmentV::Invalid),
	  mMargin(margin)
{
}

AnchorBase::AnchorBase(CrossApp::CAView* alignmentView, float margin, AnchorBase::AlignmentV alignment)
	: mAlignmentView(alignmentView),
	  mAlignmentH(AnchorBase::AlignmentH::Invalid),
	  mAlignmentV(alignment),
	  mMargin(margin)
{
}

AnchorBase::~AnchorBase()
{
}

CrossApp::CAView* AnchorBase::getAlignmentView() const
{
	return mAlignmentView;
}

AnchorBase::AlignmentH AnchorBase::getAlignmentH() const
{
	return mAlignmentH;
}

AnchorBase::AlignmentV AnchorBase::getAlignmentV() const
{
	return mAlignmentV;
}

float AnchorBase::getMargin() const
{
	return mMargin;
}

AnchorLeft::AnchorLeft()
	: AnchorBase(nullptr, 0, AnchorBase::AlignmentH::Invalid)
{
}

AnchorLeft::AnchorLeft(CrossApp::CAView* alignmentView, float margin, AnchorBase::AlignmentH alignment)
	: AnchorBase(alignmentView, margin, alignment)
{
}

AnchorLeft::~AnchorLeft()
{
}

AnchorLeft& AnchorLeft::operator =(const AnchorLeft& other)
{
	this->mAlignmentH = other.mAlignmentH;
	this->mMargin = other.mMargin;
	this->mAlignmentView = other.mAlignmentView;
	return *this;
}

AnchorRight::AnchorRight()
	: AnchorBase(nullptr, 0, AnchorBase::AlignmentH::Invalid)
{
}

AnchorRight::AnchorRight(CrossApp::CAView* alignmentView, float margin,	AnchorBase::AlignmentH alignment)
	: AnchorBase(alignmentView, margin, alignment)
{
}

AnchorRight::~AnchorRight()
{
}

AnchorRight& AnchorRight::operator =(const AnchorRight& other)
{
	this->mAlignmentH = other.mAlignmentH;
	this->mMargin = other.mMargin;
	this->mAlignmentView = other.mAlignmentView;
	return *this;
}

AnchorTop::AnchorTop()
	: AnchorBase(nullptr, 0, AnchorBase::AlignmentV::Invalid)
{
}

AnchorTop::AnchorTop(CrossApp::CAView* alignmentView, float margin,
		AnchorBase::AlignmentV alignment)
	: AnchorBase(alignmentView, margin, alignment)
{
}

AnchorTop::~AnchorTop()
{
}

AnchorTop& AnchorTop::operator =(const AnchorTop& other)
{
	this->mAlignmentV = other.mAlignmentV;
	this->mAlignmentView = other.mAlignmentView;
	this->mMargin = other.mMargin;
	return *this;

}

AnchorBottom::AnchorBottom()
	: AnchorBase(nullptr, 0, AnchorBase::AlignmentV::Invalid)
{
}

AnchorBottom::AnchorBottom(CrossApp::CAView* alignmentView, float margin,
		AnchorBase::AlignmentV alignment)
	: AnchorBase(alignmentView, margin, alignment)
{
}

AnchorBottom::~AnchorBottom()
{
}

AnchorBottom& AnchorBottom::operator =(const AnchorBottom& other)
{
	this->mAlignmentV = other.mAlignmentV;
	this->mAlignmentView = other.mAlignmentView;
	this->mMargin = other.mMargin;
	return *this;
}

AnchorHorizontal::AnchorHorizontal()
	: mLeft(AnchorLeft()),
	  mRight(AnchorRight()),
	  mWidth(0)
{
}

AnchorHorizontal::AnchorHorizontal(const AnchorHorizontal& other)
	: mLeft(other.getLeft()),
	  mRight(other.getRight()),
	  mWidth(other.getWidth())
{
}

AnchorHorizontal::AnchorHorizontal(const AnchorLeft& left, const AnchorRight& right)
	: mLeft(left),
	  mRight(right),
	  mWidth(0)
{
}

AnchorHorizontal::AnchorHorizontal(const AnchorLeft& left, float width)
	: mLeft(left),
	  mRight(AnchorRight()),
	  mWidth(width)
{
}

AnchorHorizontal::AnchorHorizontal(const AnchorRight& right, float width)
	: mLeft(AnchorLeft()),
	  mRight(right),
	  mWidth(width)
{
}

AnchorHorizontal::~AnchorHorizontal()
{
}

AnchorLeft AnchorHorizontal::getLeft() const
{
	return mLeft;
}

AnchorRight AnchorHorizontal::getRight() const
{
	return mRight;
}

float AnchorHorizontal::getWidth() const
{
	return mWidth;
}

AnchorHorizontal& AnchorHorizontal::operator =(const AnchorHorizontal& other)
{
	this->mLeft = other.mLeft;
	this->mRight = other.mRight;
	this->mWidth = other.mWidth;
	return *this;
}

AnchorVertical::AnchorVertical()
	: mTop(AnchorTop()),
	  mBottom(AnchorBottom()),
	  mHeight(0)
{
}

AnchorVertical::AnchorVertical(const AnchorVertical& other)
	: mTop(other.mTop),
	  mBottom(other.mBottom),
	  mHeight(other.mHeight)
{
}

AnchorVertical::AnchorVertical(const AnchorTop& top, const AnchorBottom& bottom)
	: mTop(top),
	  mBottom(bottom),
	  mHeight(0)
{
}

AnchorVertical::AnchorVertical(const AnchorTop& top, float height)
	: mTop(top),
	  mBottom(AnchorBottom()),
	  mHeight(height)
{
}

AnchorVertical::AnchorVertical(const AnchorBottom& bottom, float height)
	: mTop(AnchorTop()),
	  mBottom(bottom),
	  mHeight(height)
{
}

AnchorVertical::~AnchorVertical()
{
}

AnchorTop AnchorVertical::getTop() const
{
	return mTop;
}

AnchorBottom AnchorVertical::getBottom() const
{
	return mBottom;
}

float AnchorVertical::getHeight() const
{
	return mHeight;
}

AnchorVertical& AnchorVertical::operator =(const AnchorVertical& other)
{
	this->mBottom = other.mBottom;
	this->mHeight = other.mHeight;
	this->mTop = other.mTop;
	return *this;
}

AnchorLayout::AnchorLayout()
	: horizontal(AnchorHorizontal()),
	  vertical(AnchorVertical())
{
}

AnchorLayout::AnchorLayout(const AnchorLayout& other)
	: horizontal(other.horizontal),
	  vertical(other.vertical)
{
}

AnchorLayout::AnchorLayout(const AnchorHorizontal& horizontal, const AnchorVertical& vertical)
	: horizontal(horizontal),
	  vertical(vertical)
{
}

AnchorLayout::~AnchorLayout()
{
}

AnchorLayout& AnchorLayout::operator =(const AnchorLayout& other)
{
	this->horizontal = other.horizontal;
	this->vertical = other.vertical;
	return *this;
}
